Authorized Payment
Authorized Payment API
DeBox provides a payment authorization API based on vDBX to provide a broader application scenario for vDBX.
DeBox web only supports login authorization, and payment authorization is not supported
Gethttps://app.debox.pro/oauth/authorize
The onetime token API is used to generate the order number and token of integral payment, and is combined with the following /payment/transfer API to complete the integral payment function.
Parameters
Query
redirect_uri
: String
Authorization succeeded callback address, need encodeURIComponent
app_id
: String
Application unique identification, DeBox developer community application
scope
: String
Scope of authority(payment)
grant_type
: String
Type of authority(onetime_token)
amount
: Number
Amount, two decimal places at most
payer_user_id
: String
The payer. when pay_type is "send", this param is the user_id of authority; when pay_type is "receive", this param is the user_id of developer
receiver_user_id
: String
The receiver. when pay_type is "send", this param is user_id of developer; when pay_type is "receive", this param is the user_id of authority
pay_type
: String
The role of authority. pay_type is "send" means authority is payer, pay_type is "receive" means authority is receiver
pay_info
: String
Pay information
Responses
200: OK
{
"code": "xxx", //Authorize token, Valid for 5 minutes
"serial_id": "xxx", // Serial number
"source ": "debox" // From where
}
Posthttps://open.debox.pro/openapi/payment/transfer
Transfer API
Parameters
Query
app_id
: App ID, apply on platform https://developer.debox.pro/
app_secret
: App Secret, apply on platform https://developer.debox.pro/
Body
access_token
: The code from /onetime_token
serial_id
: Serial number
Responses
200: OK
{
"code": "", // error code, 1 means success
"msg": "",
"source ": "debox" // from where
}
-2001 User login validity problem, you can try to log in again
-2004 Parameter invalid
-2006 The transaction parameters are not valid
-2014 System exception, please try again
-2015 Access token Check failure
-2016 Make repeated transfer requests
-2028 System exception, please try again
-2030 System exception, please try again
-7048 The balance is insufficient, the transfer failed
-7052 System exception, please try again
When requesting token authorization, the user initiates withdrawal and jumps to user authorization. In this case, the sender is set as the platform-bound payment recipient, the receiver is the withdrawal user, and the pay type is set to receive. debox will check and accept both payment parties during authorization. After obtaining the token and serial number, the transfer interface is requested, and the transfer can be performed.